using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using Magiq.Support;

namespace Magiq.Sql {
    public class TableAdder<T,S> : IItemsAdder<T> where S : class {
        private readonly Table<S> table;

        public TableAdder(Table<S> table) {
            this.table = table;
        }

        public void Add(IEnumerable<T> items) {
            table.InsertAllOnSubmit(items.Cast<S>());
        }
    }
}